﻿/*  Kiva.NET
 *  Copyright (c) 2009 Arun Kumar 
 *  middleforce@gmail.com
 */
namespace KivaLibrary
{ 
    public enum ImageSize
    {
        w80h80, w200h200, w325h250, w450h360, fullsize
    };
    public class KivaImage
    {
        internal KivaImage() { }
        private int mID = 0;
        public int ID
        {
            get { return mID; }
            set { mID = value; }
        }
        private int mTemplateID;
        public int TemplateID
        {
            get { return mTemplateID; }
            set { mTemplateID = value; }
        }
        public string ImageURL(ImageSize imageSize)
        {
            if (this.ID == 0)
            {
                return "";
            }
            string strSize;
            switch (imageSize)
            {
                case ImageSize.w80h80:
                    strSize = "w80h80";
                    break;
                case ImageSize.w200h200:
                    strSize = "w200h200";
                    break;
                case ImageSize.w325h250:
                    strSize = "w325h250";
                    break;
                case ImageSize.w450h360:
                    strSize = "w450h360";
                    break;
                case ImageSize.fullsize:
                    strSize = "fullsize";
                    break;
                default:
                    strSize = "w80h80";
                    break;
            }
            return "http://kiva.org/img/" + strSize + "/" + this.ID + ".jpg";
        }
    }
}
